class CreateAgendas < ActiveRecord::Migration
  def self.up
    create_table :agendas do |t|
      t.references :curso
      t.date :data_inicial, :null => false
      t.date :data_final, :null => false
      t.string :descricao,  :limit => 200, :null => false

      t.timestamps
    end
    execute("alter table agendas add foreign key (curso_id) references cursos(id)")
  
  end

  def self.down
    drop_table :agendas
  end
end
